<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
		<link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>
	    <style>
	        input[type="text"] {
	            height: 25px;
	            outline: none;
	            border: 0;
	            border: 1px solid #CCCCCC;
	            padding: 0 4px;
	        }
	    </style>
	    <script src="http://webapi.amap.com/maps?v=1.3&key=e06178925b8ec4746ca36a53593d07dd"></script>
	    <script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>
	</head>
	<body>
<div id="container"></div>
	<div class="button-group">
	    <input id="cityName" class="inputtext" placeholder="请输入城市的名称" type="text"/>
	    <input id="query" class="button" value="到指定的城市" type="button"/>
	</div>
	<script>
	    var map = new AMap.Map('container', {
	        resizeEnable: true
	    });
	    //设置城市
	    AMap.event.addDomListener(document.getElementById('query'), 'click', function() {
	        var cityName = document.getElementById('cityName').value;
	        if (!cityName) {
	            cityName = '北京市';
	        }
	        map.setCity(cityName);
	    });
	</script>
	</body>
</html>
